let Highcharts = require('highcharts');
// 创建渐变色
Highcharts.getOptions().colors = Highcharts.map(Highcharts.getOptions().colors, function (color) {
	return {
		radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
		stops: [
			[0, color],
			[1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
		]
	};
});
module.exports = {
    bar: {
        title: {
            text: '2020年全国各地疫情人数占比'
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                    style: {
                        color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                    },
                    connectorColor: 'silver'
                }
            }
        },
        series: [{
            type: 'pie',
            name: '疫情占比',
            data: [
                ['武汉',   45.0],
                ['上海',       26.8],
                {
                    name: '广州',
                    y: 12.8,
                    sliced: true,
                    selected: true
                },
                ['天津',    8.5],
                ['广西',     6.2],
                ['其他',   0.7]
            ]
        }]
    }
}
